import { IncomingHttpHeaders } from 'http';

import operate from '@dfeidao/atom-nodejs/db/operate';
import { systemid } from '../../atom/config';
interface Message {
	filter: {
		productid: string,
		exam_id: string,
		candidate_no: string,
		exam_score: string,
		exam_time: string,
		paper_number: string
	};
	// cookie: {
	// 	uk: string;
	// 	[key: string]: string
	// };
	// urls: {
	// 	base: string;
	// 	origin: string;
	// 	url: string;
	// };
	// query: {};
	// params: {};
	// headers: {};
	// captcha: string;
}


export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const { exec, insert } = operate(action_id, session_id, systemid);
	// 插入数据
	insert('exam_paper', message.filter);
	const res = await exec();
	return res;
}
